package com.spddr.pmos.cxf;

import java.util.Collection;

import javax.ws.rs.GET;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;

import com.spddr.pmos.jpa.Plant;
import com.spddr.pmos.jpa.Substation;
import com.spddr.pmos.jpa.Unit;

import cn.seqdata.cxf.repos.JaxrsObjectRepository;

@Path("/plant")
public interface JaxrsPlant extends JaxrsObjectRepository<Plant> {
	@PUT
	@Path("/")
	default <S extends Plant> S save(S entity) {
		return getRepository().save(entity);
	}

	@GET
	@Path("/{id}/units")
	Collection<Unit> units(@PathParam("id") long id);

	@GET
	@Path("/{id}/substations")
	Collection<Substation> substations(@PathParam("id") long id);
}
